<% content_for(:page_header) {"Participate in our polls right now!"} %>

<% @polls.each do |poll| %>
  <div class="well">
    <h2><%= poll.topic %> <small>(voted: <%= poll.votes_summary %>)</small></h2>

    <p>
      <% if current_user %>
        <%= link_to 'Participate!', poll_path(poll), class: 'btn btn-primary btn-lg block' %>
      <% else %>
        Please sign in via <%= link_to 'Signin' %> to participate in this poll.
      <% end %>
    </p>

    <div class="btn-group">
      <%= link_to 'Edit', edit_poll_path(poll), class: 'btn btn-default' %>
      <%= link_to 'Delete', poll_path(poll),
                  method: :delete,
                  class: 'btn btn-danger', data: {confirm: 'Are you sure?'} %>
    </div>
  </div>
<% end %>